package com.ju.demo.constant;

/**
 * 错误产生来源分为 A/B/C，A 表示错误来源于用户，比如参数错误，用户安装版本过低，用户支付超时等问题；
 * B 表示错误来源于当前系统，往往是业务逻辑出错，或程序健壮性差等问题；C 表示错误来源于第三方服务，比如 CDN
 * 服务出错，消息投递超时等问题；四位数字编号从 0001 到 9999，大类之间的步长间距预留 100
 */
public enum ResultCodeConstant {
    SUCCESS("00000","操作成功！","操作成功！"),
    SAVE_EXCHANGE_TEAM_FAIL("B0001","交换班信息保存失败！","ExchangeTeamServiceImpl-AddExchangeTeam()问题"),
    REMOVE_EXCHANGE_TEAM_FAIL("B0100","删除交换班信息失败！","ExchangeTeamServiceImpl-DeleteExchangeTeam()：删除时返回为0"),
    UPDATE_EXCHANGE_TEAM_FINDINFO_BYID_FAIL("B0202","修改交换班信息时查询数据失败！","ExchangeTeamServiceImpl-updateExchangeTeam()：查询数据时，得到数据为空"),
    UPDATE_EXCHANGE_TEAM_FAIL("B0201","修改交换班信息保存失败！","ExchangeTeamServiceImpl-updateExchangeTeam()：保存信息失败！");

    //错误码-五位分成两个部分：错误产生来源+四位数字编号  正常状态返回00000
    private final String errorCode;
    //错误信息
    private final String errorMsg;
    //建议信息
    private final String tipMag;

    ResultCodeConstant(String errorCode, String errorMsg, String tipMag) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
        this.tipMag = tipMag;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public String getTipMag() {
        return tipMag;
    }
}
